# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kuba Serafinowski <zizzfizzix(at)gmail(dot)com>

pkgname=owncloud-client
pkgver=5.1.2.12600
pkgrel=1
pkgdesc='ownCloud client based on mirall'
arch=(loong64 x86_64)
url='http://owncloud.org/'
license=(GPL2)
depends=(gcc-libs
         glibc
         kdsingleapplication
         libre-graph-api
         qt6-base
         qtkeychain-qt6
         sqlite
         zlib)
makedepends=(doxygen
             extra-cmake-modules
             python-sphinx
             qt6-tools)
             # kio - reenable with KF6
optdepends=('nemo-python: integration with Nemo'
            'python-caja: integration with Caja'
            'python-nautilus: integration with Nautilus')
backup=('etc/ownCloud/sync-exclude.lst')
source=(https://download.owncloud.com/desktop/ownCloud/stable/$pkgver/source/ownCloud-$pkgver.tar.xz{,.asc})
sha256sums=('1e361814c8b3b8b57f2e13fe7dff3043a4b30d1e894bde2b8a71e85abecd8353'
            'SKIP')
validpgpkeys=(F05F7DD7953A07DF36579DAA498C45EBE94E7B37) # ownCloud Client Team (Signing Key) <info@owncloud.com>

build() {
  cmake -B build -S ownCloud-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_SKIP_INSTALL_RPATH=ON \
    -DBUILD_TESTING=OFF \
    -DKDE_INSTALL_SYSCONFDIR=/etc
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
